import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 整数变换
 * User: DELL
 * Date: 2024-05-13
 * Time: 23:01
 */
public class Main3 {
    /**
     * 本题是签到题，没有什么好的解法，直接暴力求解也可以过
     *
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = 1000000000;
        int res = 0;
        long ans = 0;
        while (n > 0) {
            res++;
            int temp = n;
            int temp2 = 0;
            while (temp != 0) {
                temp2 += temp % 10;
                temp /= 10;
            }
            n -= temp2;
        }
        System.out.println(res);
    }
}
